﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package com.fminutes.vinciDll.analyze {
    import com.fminutes.vinciDll.*;
    import flash.utils.*;

    public class DDDAnalyze extends AnalyzeBase {

        private var dddList:Object;
        private var _subClassDic:Dictionary;

        public function DDDAnalyze(){
            this.dddList = {};
            this._subClassDic = new Dictionary();
            super();
        }
        override public function analyze(_arg1:ByteArray, _arg2:DllFileObject, _arg3:Function):void{
            var _local4:ByteArray = _arg1;
            _local4.uncompress();
            var _local5:Object = _local4.readObject();
            var _local6:String = _arg2.name;
            this.dddList[_local6] = {
                data:_local5,
                hasServerId:_arg2.serverid
            };
            _arg2.result = _local5;
            _arg2.status = DllFileObject.LOADED;
            _arg3();
        }
        public function getDDDDataByName(_arg1:String):Object{
            var _local2:Object;
            _local2 = this.dddList[_arg1]["data"];
            if (!_local2){
                _local2 = [];
            };
            return (_local2);
        }
        public function getDataByServerId(_arg1:String):Array{
            var _local3:String;
            var _local4:int;
            var _local2:Array = [];
            for (_local3 in this.dddList) {
                if (this.dddList[_local3].hasServerId == "1"){
                    _local4 = 0;
                    while (_local4 < this.dddList[_local3].data.length) {
                        if (this.dddList[_local3].data[_local4].serverId == _arg1){
                            _local2.push(this.dddList[_local3].data[_local4]);
                        };
                        _local4++;
                    };
                };
            };
            return (_local2);
        }
        public function getMaterialDataByServerId(_arg1:String):Object{
            var _local2:Object;
            var _local3:String;
            var _local4:Object;
            var _local5:String;
            for (_local3 in this.dddList) {
                if (this.dddList[_local3].hasServerId == "1"){
                    _local4 = this.dddList[_local3].data;
                    for (_local5 in _local4) {
                        if (_local4[_local5].serverId == _arg1){
                            _local2 = _local4[_local5];
                            break;
                        };
                    };
                };
            };
            return (_local2);
        }
        public function getMaterialDataByServerIdAndSunClass(_arg1:String, _arg2:String):Object{
            var _local3:Object;
            var _local5:String;
            var _local6:Object;
            var _local7:String;
            var _local4:String = (_arg1 + _arg2);
            _local3 = this._subClassDic[_local4];
            if (_local3 != null){
                return (_local3);
            };
            for (_local5 in this.dddList) {
                if (_local3){
                    break;
                };
                if (this.dddList[_local5].hasServerId == "1"){
                    _local6 = this.dddList[_local5].data;
                    for (_local7 in _local6) {
                        if ((((_local6[_local7].serverId == _arg1)) && ((_local6[_local7].subclass == _arg2)))){
                            _local3 = _local6[_local7];
                            this._subClassDic[_local4] = _local3;
                            break;
                        };
                    };
                };
            };
            return (_local3);
        }

    }
}//package com.fminutes.vinciDll.analyze 
